Previous Book Contents Book Index Next

Inside Macintosh: /
QuickDraw 3D RAVE / QuickDraw 3D RAVE Reference
QuickDraw 3D RAVE Routines / Texture and Bitmap Methods


TQATextureNew

A drawing engine may define a method to create a new texture map. This method is optional and must be supported only by drawing engines that support texture mapping.

typedef TQAError (*TQATextureNew) (
                                   unsigned long flags, 
                                   TQAImagePixelType pixelType, 
                                   const TQAImage images[], 
                                   TQATexture **newTexture);
flags
A set of bit flags specifying features of the new texture map. See "Texture Flags Masks" (page 1-64) for complete information.
pixelType
The type of pixels in the new texture map. See "Pixel Types" (page 1-35) for a description of the values you can pass in this parameter.
images
An array of pixel images to use for the new texture map. The values in the width and height fields of these structures must be an even power of 2.
newTexture
On entry, the address of a pointer variable. On exit, that variable points to a new texture map. If a new texture map cannot be created, *newTexture is set to the value NULL.
DESCRIPTION
Your TQATextureNew function is called whenever an application calls QATextureNew. Your function should perform any tasks required to use the texture in texture-mapping operations. This might involve loading the texture into memory on the device associated with your drawing engine. If so, your TQATextureNew function should not return until the texture has been completely loaded.

The flags parameter specifies a set of texture map features. If the kQATexture_Lock bit in that parameter is set but your drawing engine cannot guarantee that the texture will remain locked in memory, your TQATextureNew function should return an error.

If the kQATexture_Mipmap bit of the flags parameter is clear, the images parameter points to a single pixel image that defines the texture map. If the kQATexture_Mipmap bit is set, the images parameter points to an array of pixel images of varying pixel depths. The first element in the array must be the mipmap page having the highest resolution, with a width and height that are even powers of 2. Each subsequent pixel image in the array should have a width and height that are half those of the previous image (with a minimum width and height of 1).


Previous Book Contents Book Index Next

© Apple Computer, Inc.
28 AUG 1996